package com.sell;


public class Sell {

	public static void main(String[] args) {

		double goTicketPrice = 10;
		double backTicketPrice = 30.5;
		double tenTelPrice = 28;
		double totalPrice = 200;
		
		deal(goTicketPrice, backTicketPrice,tenTelPrice,totalPrice);

	}

	private static void deal(double goTicketPrice, double backTicketPrice,double tenTelPrice,double totalPrice) {
		
		for (int i = 0;goTicketPrice!=0 && i < totalPrice / goTicketPrice; i++) {
			for(int j=0;backTicketPrice!=0 && j<totalPrice / backTicketPrice;j++){
				for(int h=0;tenTelPrice!=0 && h<totalPrice / tenTelPrice;h++){
					if((goTicketPrice*i)+(backTicketPrice*j)+(tenTelPrice*h)==totalPrice){
						System.out.println("可以买"+i+"张"+goTicketPrice+"--"+j+"张"+backTicketPrice+"--"+h+"张"+tenTelPrice);
					}else if((goTicketPrice*i)+(backTicketPrice*j)+(tenTelPrice*h)>totalPrice){
						break;
					}
				}
			}
		}
	}

}
